# encoding: UTF-8
'''
Created on 2013-9-8

@author: Ben

功勋榜
'''

from ..common import Command, Logger, RequestModel
from ..common.SocketService import gameSocketService
import ResourceData

class FeatListGetInfoRequest(RequestModel.RequestModel):
    '''
    classdocs
    '''
    
    def setCommand(self):
        self.command = Command.GET_FEATLIST_INFO
        
    def onReceive(self, data):
        ResourceData.updateFeatList(data)

'''
领取功勋榜宝箱奖励
'''
def getFeatListBoxReward():
    command = Command.GET_FEATLIST_BOX_REWARD
    params = ''
    gameSocketService.send(command, params, getFeatListBoxRewardCallback)
    
'''
领取功勋榜宝箱回调函数
'''
def getFeatListBoxRewardCallback(data):
    if 'type' in data and 'num' in data:
        Logger.log('领取功勋榜宝箱奖励, type:' + str(data['type']) + ', num:' + str(data['num']), output = True)